import java.util.Objects;
import java.util.Scanner;

public class hw11 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String passWord = "123456";
        System.out.println("请输入密码：");
        int n = 1;
        while (n <=3) {
            String testNum = scanner.nextLine();
            if (Objects.equals(testNum, passWord)) {
                System.out.println("输入正确！！");
                break;
            } else {
                System.out.println("输入错误！重新输入。。");
                n++;
            }
        }
        if (n > 3) {
            System.out.println("密码输入错误三次，程序退出");
        }
        else {
            System.out.println("登陆成功");
        }



    }
}
